package com.iptv.grape.event.imp;

import com.google.gson.Gson;
import com.iptv.grape.BaseActivity;
import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.event.JSRequest;
import com.iptv.grape.event.msg.InitHotChannelListData;
import com.iptv.grape.event.proc.IWebViewMessageProc;
import com.iptv.grape.util.AppLog;
import com.iptv.grape.video.XMediaPlayer;

// 初始化热播频道
public class InitHotChannelList implements IWebViewMessageProc {

    private InitHotChannelListData args;

    @Override
    public void init(JSRequest jsRequest) {
        args = new Gson().fromJson(jsRequest.getJson(), InitHotChannelListData.class);

    }

    @Override
    public String procMessage(BaseActivity baseActivity, XMediaPlayer mediaPlayer) {
        if(args != null && args.getData().size() > 0){
            GrapeContext.curGrapeContext().setHotChannelListDataArgs(args);
        }
        return "";
    }
}
